package com.lovestacks.tj.dao;

import com.lovestacks.tj.bean.PersonInfomation;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

@Repository
public interface PersonInfoDao {
    @Update("update person_information set name = #{name},phone = #{phone},depart = #{depart},menu = #{menu} where openId = #{openId}")
    public int updatePersonInfo(PersonInfomation personInfomation);
    @Insert("insert into person_information(openId ,name, phone, depart, menu) values(#{openId},#{name},#{phone},#{depart},#{menu})")
    public int insertPersonInfo(PersonInfomation personInfomation);
    @Select("select count(*) from person_information where openId = #{openId}")
    public int getPersonInfoNum(PersonInfomation personInfomation);
    @Select("select * from person_information where openId = #{openId}")
    public PersonInfomation getPersonInfo(String openId);
}
